<template>
  <div>
    <preHeader></preHeader>
    <div class="top-block"></div>
    <div id="instructions" v-for="(item,index) in staffInfo" :key = 'index'>
    <p class="title">{{item.title}}</p>
    <p class="txt" v-html="item.content"></p>
    <p class="date">{{new Date(parseInt(item.add_time) * 1000).toLocaleString().replace(/:\d{1,2}$/,' ')}}</p>
    </div>

  </div>
</template>

<script>
  import {get_staff} from '@/api/';
  export default {
    data(){
      return{
        staffInfo:''
      }
    },
    methods:{
      getStaff(){//获取员工须知列表
        get_staff().then(res =>{
          // console.log(res)
          this.staffInfo = res.data;
        })
      }
    },
    mounted(){
      this.getStaff();
    }
  }
</script>

<style scoped>
 #instructions{padding: 20px;border: 1px solid #ddd;margin-bottom: 10px;margin: 10px;border-radius: 6px;}
.title{color: #333;font-size: 16px;font-weight: bold;}
.txt{color: #666;font-size: 14px;margin-top: 17px;line-height: 22px;}
.date{font-size: 14px;color: #333;float: right;}
</style>
